(set: $name to (prompt: "Greetings, adventurer. What is your name?", "Avatar"))
So, $name, it's your last morning in the barracks maintained by the Adventurers' Guild of the mountain town of Spitz. Your boots are waxed, your bag is packed, your sword is ready at your side and your mind is full of all the training you recieved during your intensive one-month Road To Adventureā¢ course.
The barracks are located just outside the town of Spitz, to keep roaming adventurers from offending the delicate sensibilities of the locals. If you make enough of a name for yourself as a monster hunter, maybe you'll be invited inside the town walls.
Through the narrow window, you can see a muddy crossroads.
(link: "It's time to go")[
(set: $hp to 15)
(set: $max_hp to 15)
(set: $reputation to 0)
(set: $atk to 11)
(set: $luck to 7)
(set: $battlecry to "You shall die by my sword!")
(goto: "Muddy crossroads")
]
<!-- The (prompt:) macro creates a text box that you can capture the input from. The second bit of text in quotes, "Avatar", is the suggested text for the entry box, in case the player doesn't want to come up with their own name.
Our hero has pre-configured stats, which we (set:) when they leave this passage. However, for a more sophisticated RPG-like experience, you could have use the (random:) macro to have the player roll dice and (set:) those numbers as their stats. -->
You are standing at the crossroads outside the town of Spitz. To the north stand the firmly closed town gates. To the south lies the vast, evergreen Spitzwald Forest.
The western road leads to a graveyard. The road to the east, down which you came a short month ago, normally leads through the Spitzberg mountains, but an early snow has blocked the pass.
The (link: "Adventurers' Guildhall")[Adventurers' Guildhall - which already looks small and remote; a piece of your past that you won't be returning to -] and a tavern stand at the crossroads.
(link: "Go north to town")[(goto: "Town gate")]
[[Go east to the pass->Snow-filled pass]]
[[Go south to the forest->Into the forest]]
[[Go west to the cemetery->Cemetery gates]]
[[Visit the tavern]]
<!-- You can see a few different types of these here. In the third paragraph, we've used a link to expand some additional detail about the Guildhall.
Below, we've demonstrated the (link:)(goto:) combination, which is normally used when you want to add extra macros to a link, but here has been used in its simplest form for demonstration purposes. Note that your link text and destination both have to be in inverted commas.
The simplest kind of link is just the name of a passage between two pairs of square brackets, like [[Visit the tavern]].
You can also use pairs of square brackets to create links where the link text differs from the name of the destination passage by putting a hyphen and a greater than sign between them to make an arrow. -->The dappled light of a late autumn sun shines through the branches of densely packed evergreen trees. There's a hint of snow on the breeze and you can hear the squabbling of jays among the treetops.
A carpet of pine needles mutes the sound of your footsteps. A narrow animal track winds through the trees to the south, leading deeper into the woods.
Looking around, you notice that a steep rocky bluff conceals a narrow cave entrance. To the east, you can hear the faint sound of running water.
[[Return to the crossroads->Muddy crossroads]]
[[Go deeper into the forest]]
[[Explore the cave]]
[[Follow the sound of running water]]
(if: $reputation < 3)[Only adventurers of a certain reputation are allowed into the town of Spitz. That does not include you.
[[Return to the crossroads->Muddy crossroads]]
]
(else:)[The town guard looks you up and down sceptically.
"All right," she says distainfully. "I suppose you can come in. Here's your reward for clearing up our monster problem."
She hands you a discouragingly light pouch of coins and opens the inner gate to reveal the cobbled streets and slate roofs of Spitz. You hope there's enough in there to get you a decent meal and a bed for the night.
YOU HAVE WON!
Welcome to the thankless career of professional adventuring!
<center><img src="victory%20arch.jpg"; alt="victory gate"></center>
]
<!-- To win, the player has to resolve three quests. Four are available, and each victory passage increments their $reputation variable by one.
We've used normal HTML code to insert a picture here. You can embed music or even YouTube video in a similar manner to add multimedia features to your adventure. These comments also use the HTML commenting standard to keep them from being visible to the player. -->
As you push your way through increasingly dense trees and bramble thickets, wincing as thorns and branches scrape at your skin, you stumble and hear a distict crunching sound underfoot.
(if: $skeleton is not "defeated")[The ground is littered with shining white bones, one of which you've just trodden on. You look on in horror as the bones begin to move, pulling themselves together into the form of an animate skeleton.
Whatever armour it may have once have had clearly decayed away long ago, and it holds an extremely blunt and rusty sword in one clattering hand.
(link: "Fight the skeleton")[(set: $mob_hp to 10)(set: $monster_atk to 6)(set: $monster to "The skeleton")(goto: "Fight the skeleton")]
[[Flee->Into the forest]]
]
(else-if: $skeleton is "defeated")[[[Go back the way you came->Into the forest]]]
<!-- We're using an (if:) macro with an IS NOT condition to check to see if we've already set the $skeleton variable as "defeated". If not, the player character gets to face off against the walking dead.
Note that we haven't put any conditions on the Flee link - skeletons aren't very agile. However, we can make it harder to escape from difficult combat scenarios, which you can see in the passage named Fight the ghast. -->(if: $swam is not 1)[You tramp through the forest, following the sound of flowing, splashing water that gradually becomes louder until you shoulder your way between a particularly dense line of trees to emerge into a clearing alongside a river.]
(if: $swam is 1)[Although the day is cold, your clothes dry quickly enough in the bright midmorning sunlight. Eventually, your trek north along the riverbank leads you to a forest clearing alongside a bend in the river. (set: $swam to 0)]
Clear, sparkling water pours over a rocky weir, catching the late autumn sun as it splashes into the air, conjuring tiny, jeweled rainbows.
(if: $necklace is not "returned")[Despite the lateness of the year, you see a young woman sitting on the rocks, dangling her bare feet and legs into the stream. She has blue skin, pale green hair and, when she turns to acknowledge you, you see that her eyes are the colour of blazing emeralds.
[[Talk to the river nymph]]
(link: "Fight the river nymph")[(set: $mob_hp to 50)(set: $monster_atk to 30)(set: $monster to "The river nymph")(goto: "Fight the river nymph")]]
[[Return to the forest->Into the forest]]
<!-- If we've returned the necklace to the nymph, she's no longer here. If that IS NOT the case, we have the game display a passage that lets the player talk to or fight her. Note that her high $monster_atk stat makes her unbeatable within the game's current parameters.
We don't want the player to face her head-on. This problem can only be solved if the player picked up her lost necklace after defeating the skeleton in the forest.
Even if they miss that, it doesn't make the game unwinnable, as there are four quests to tackle, and the player only needs to succeed at three of them.
As well as getting here by walking through the forest, the player can end up at the river if they survive a luck roll in the taven's beer cellar. Because of this, we've made sure that the passage of text about tramping through the forest only shows up if we've not set the $swam variable to 1.
We also set the variable to 0 here to make sure that the river approach text doesn't show up on future visits. -->You gaze across the snow-blocked pass as a cold wind whips at your face and hair, filled with the icy promise of winter.
A little over a month ago the pass was clear, your route to Spitz and to a life of exotic adventure, far from the mundane deserts, oases and caravans that were the background to life with your merchant family, far to the south.
(if: $keystory is 1)[Mindful of the gravedigger's words, you claw through the piles of snow and rock until your fingers are numb with cold. You're about to give up, when you see the glint of metal. You put the ornate brass key in your pouch.
(set: $key to 1)]
[[Go back to the crossroads->Muddy crossroads]]
<!-- The $key and $keystory variables here are event flags for the quest to clenase the cemetary that starts by talking to the gravedigger. -->
(if: $key is not 2)[As you approach the cemetery, the sky darkens. Heavy shadows seem to emanate from the heart of the graveyard, almost driving out the weak sunlight.]
The cemetery is surrounded by an unusually tall and sturdy wall. The tops of tall trees, rich in their autumnal colours, are just visible over the top of it.
A pair of wrought iron gates stand at what appears to be the only entrance to the graveyard.
Some distance away, warming his hands by a stove in a stone lean-to against the outer wall of the graveyard, you can see the gravedigger.
[[Enter the cemetery]]
[[Speak to the gravedigger]]
[[Go back to the crossroads->Muddy crossroads]]
<!-- If we've not completed the key and ghast quest, an omnious extra paragraph is added to the description of the cemetery. -->The gravedigger is a short, strikingly pale man in his mid-forties, with the kind of muscles that only come from a lifetime of hard, outdoor work. He wears his greying hair in a braid down his back. He looks up as you approach him.
(if: $ghast is not "defeated")["You don't want to go into the boneyard," he says. "There's a ghast haunting the place. And I couldn't let you in, even if you were fool enough to ask. I locked the gate and threw the key into the pass." (set: $keystory to 1)]
(else:)[I appreciate you going and taking care of that ghast. It'll be a while before I get the nerve up to go back into that old boneyard, all the same."]
[[Back to the cemetery gates->Cemetery gates]]
<!-- We want the gravedigger to acknowledge when the monster has been removed from the cemetery, so we check to make sure that there IS NOT a flag indicating that the player has defeated the ghast. If we don't find that flag, the gravedigger gives the player the first part of the cemetery quest, and we set the $keystory variable to one, which will unlock a flag-triggered text passage in the snowy pass. -->
The cave is narrow, gloomy and damp, but doesn't seem to be all that deep. You grope your way to the end of the rocky tunnel, guided by the faint sunlight still visible through the cave's mouth.
There's a foul stench towards the rear of the cave.
(if: $rat is not "defeated")[
It grows stronger the further you move from the light. You reach the cave's rear wall and, finding nothing of immediate interest, turn around.
It takes all your self-contol not to yelp as you're confronted by an immense rat, longer than you are tall from nose to hind quarters, with a tail as thick as a ship's rope.
(link: "Fight the giant rat")[(set: $mob_hp to 12)(set: $monster_atk to 8)(set: $monster to "The giant rat")(goto: "Fight the giant rat")]
[[Flee->Into the forest]]
]
(else-if: $rat is "defeated")[[[Go back the way you came->Into the forest]]](if: $key is 1)[The large brass key from the snowdrift turns smoothly in the lock of the enormous gates, which open with barely a sound.
As you step through them, you're enveloped in darkness, in defiance of the brightness of the day outside.
Glowing green and white fire flickers around the edges of your vision as a ragged, skull-faced spectre rises up from the gravestones before you.
(if: $phylactery is 1)[You feel a sudden heat where your pouch rests on your belt. The glass phylactery you found in the rat cave is glowing red and almost too hot to touch.
[[Throw the phylactery]]]
(link: "Fight the ghast")[(set: $mob_hp to 20)(set: $monster_atk to 15)(set: $monster to "The ghast")(goto: "Fight the ghast")]
[[Run back the way you came->Cemetery gates]]]
(else-if: $key is 2)[The large brass key is still in the gate where you left it. You walk through into a peaceful, well-tended graveyard. Tall trees and carefully arranged flowers among the graves give the place a feeling of tranquillity.
Gold and red fallen leaves crunch underfoot and the mountain air is cool and refreshing. You stop for a moment to remember those gone before and clear your head.
[[Leave the cemetery->Cemetery gates]]]
(else:)[The cemetery gates are resolutely shut, and the high wall surrounding the graveyard is solid and impassable. From inside, you hear an unearthly wailing and see light and darkness flicker oddly. You can only [[go back the way you came->Cemetery gates]]]
<!-- This is a complex passage with multiple optional text sections that will display depending on what event flags have been set by the player's actions in the game.
If they've found the key, they'll open the gates.
If they found the magic phylactery in another monster's treasure, they can use it to defeat the ghast. Fighting the ghast will be tough until the player has levelled up their $atk stat using magic potions found elsewhere.
If they've already defeated the ghast - after which we set the $key vaiable to 2 elsewhere - they see only a tranquil cemetery.
Otherwise (else:) they cemetery is locked and spooky.
-->
Combat against the ghast!
(set: $hero_roll to (random: 1, 10))
(set: $mob_roll to (random: 1, 10))
(set: $hero_atk to $atk + $hero_roll)
(set: $mob_atk to $monster_atk + $mob_roll)
Dice rattle... your attack is $hero_atk. $monster's attack is $mob_atk.
(if: $mob_atk > $hero_atk)[
(set: $hp to $hp - 2)[$monster's eerie tendrils lash out at you, freezing your flesh where they make contact. $monster's HP is $mob_hp. Your HP is now $hp.]
(if: $hp > 0)[
[You shudder in horror but steady yourself.]
(link: "Attempt escape")[
(if: $luck > (random: 1,12))[(goto: "Enter the cemetery")]
(else:)[You try to flee but a greenish tendril wraps around you and drags you back. [[Continue->Fight the ghast]].]]
(link-goto: "Keep fighting", "Fight the ghast")
]
(else:)[
[YOU HAVE DIED]
(link:"Restart")[(reload:)]
]
]
(else-if: $hero_atk > $mob_atk)[
(set: $mob_hp to $mob_hp - 2)[Your blow hits home. $monster's HP is now $mob_hp. Your HP is $hp.]
(if: $mob_hp > 0)[
[$monster gives a banshee wail and flickers out existence for a momoent as your weapon makes contact.]
(link: "Attempt escape")[
(if: $luck > (random: 1,12))[(goto: "Enter the cemetery")]
(else:)[You try to flee but a greenish tendril wraps around you and drags you back. [[Continue->Fight the ghast]].]]
(link-goto: "Keep fighting", "Fight the ghast")
]
(else:)[
[[YOU ARE VICTORIOUS!->Search the crypt]]
]
]
(else-if: $mob_atk is $hero_atk)[
[You hurl yourselves towards each other, but miss. $monster's HP is $mob_hp. Your HP is $hp.]
(link: "Attempt escape")[
(if: $luck > (random: 1,12))[(goto: "Enter the cemetery")]
(else:)[You try to flee but a greenish tendril wraps around you and drags you back. [[Continue->Fight the ghast]].]]
(link-goto: "Keep fighting", "Fight the ghast")
]
<!-- We've added an extra challenge to this combat sequence. Although the ghast isn't unbeatable, we want to make it a tough foe, particularly if tackled early in the game.
To make it more difficult, we've added a luck roll to any attempt to escape. The game rolls a 12-sided die, and the player only successfully escapes if their luck is higher than the result of that roll. -->
The tavern is warm and cosy, with a crackling fire in the hearth and the swords and trophies of generations of adventurers hung upon the walls. It is also empty, but for the tavenkeeper, who looks up from polishing a tankard and waves at you.
"What-ho, $name!" She shouts. She's a stout, brown-haired woman with skin almost as dark as your own. She bears the scars, battle-ready stance and confident attitude of a retired adventurer.
"Finally finished the guild training course, eh?" She smiles broadly. "Would you like to hear about the (link:"quests")[quests(show:?quests)] I know of around here?"
|quests)["Well, there's something scaring off forragers in the forest, on top of the ususal giant rats. I've heard there's an undead of some kind in the graveyard. Oh, and keep an eye out for water nymphs. They get vicious at this time of year."
"Clear some of those those, and maybe they'll even let you into town to receieve your reward, eh?" She chuckles and grins to herself as if she's just told a joke.
"Oh, and there's that thing in the (link-reveal: "beer cellar.")[ You can [[go on down->Beer cellar]] there, if you like. But I wouldn't recommend it.]"
]
(link:"Order a drink")[The barkeep hands you a tankard, which you gulp down gratefully. The cool draft revives you and restores you will to continue on the Road to Adventureā¢. (set: $hp to $max_hp) (Your health has been fully restored.)]
[[Go out to the crossroads->Muddy crossroads]]
<!-- You can order a drink at the tavern to fully replenish your health if you get a bit banged up in battle. (Because beer totally does that in real life... no. Wait. The other thing.)
You can also get a clear look at how to use a combination of the (link:) and (show:) macros to create a hidden ?hook called quests, which we've used to reveal more text further down the page if you want to know more about the quests in the area.
We've also used a (link-reveal:) macro to unfold an extra bit of the passage when it's clicked. -->Combat against the skeleton!
(set: $hero_roll to (random: 1, 10))
(set: $mob_roll to (random: 1, 10))
(set: $hero_atk to $atk + $hero_roll)
(set: $mob_atk to $monster_atk + $mob_roll)
Dice rattle... your attack is $hero_atk. $monster's attack is $mob_atk.
(if: $mob_atk > $hero_atk)[
(set: $hp to $hp - 2)[$monster strikes you. $monster's HP is $mob_hp. Your HP is now $hp.]
(if: $hp > 0)[
[You reel but keep your footing.]
(link-goto: "Attempt escape", "Into the forest")
(link-goto: "Keep fighting", "Fight the skeleton")
(link: "Yell a fearsome battlecry")[
You take a breath and shout: "$battlecry"
$monster seems unimpressed.]
]
(else:)[
[YOU HAVE DIED]
(link:"Restart")[(reload:)]
]
]
(else-if: $hero_atk > $mob_atk)[
(set: $mob_hp to $mob_hp - 2)[Your blow hits home with a crack of splintering bone. $monster's HP is now $mob_hp. Your HP is $hp.]
(if: $mob_hp > 0)[
[$monster stumbles but regains its balance.]
(link-goto: "Attempt escape", "Into the forest")
(link-goto: "Keep fighting", "Fight the skeleton")
]
(else:)[
[[YOU ARE VICTORIOUS!->Search the skeleton's barrow]]
]
]
(else-if: $mob_atk is $hero_atk)[
[You lunge at each other but both miss. $monster's HP is $mob_hp. Your HP is $hp.]
(link-goto: "Attempt escape", "Into the forest")
(link-goto: "Keep fighting", "Fight the skeleton")
]
<!-- If we wanted to add a bit of variety to combat, we could use a (random:) macro to select from one of a range of descriptions of the fight.
We've added an option of yelling the $battlecry we set earlier if the play is hit by the monster. Note that when using a (link:) macro inside a passage, whatever text you put in the [square brackets] that follow it replaces the original link text.
If you want to retain the original link text, check out the ((link-reveal:) macro, which you'll find used in the passage named Beer cellar. -->
-->(set: $reputation to $reputation +1)
(set: $skeleton to "defeated")
The skeletal warrior collapses into a shower of bone shards, just in front of a shallow barrow made of stone and earth. Braving its musty-smelling depths, you search the tomb.
Your reputation is now $reputation.
You find a (link:"potion")[potion(show:?potion)], a silver (link:"necklace")[necklace(show:?necklace)] and a steel (link:"axe")[axe(show:?axe)]. You're just glad the creature didn't think to use the axe instead of its rusty sword.
|potion)[After a moment's consideration, you drink the potion. Not poison, apparently. (+2 max health, your health is replenished) (set: $max_hp to $max_hp +2)(set: $hp to $max_hp)]
|necklace)[The disc-shaped silver pendant has something that looks like a stylised crystal of snow etched into it. You examine it for a moment before sliding it into your pouch. (set: $necklace to "taken")]
|axe)[The axe is a far finer weapon than your sword. You take it. (+2 attack) (set: $atk to $atk +2)]
[[Return to the forest->Into the forest]]
Combat against the giant rat!
(set: $hero_roll to (random: 1, 10))
(set: $mob_roll to (random: 1, 10))
(set: $hero_atk to $atk + $hero_roll)
(set: $mob_atk to $monster_atk + $mob_roll)
Dice rattle... your attack is $hero_atk. $monster's attack is $mob_atk.
(if: $mob_atk > $hero_atk)[
(set: $hp to $hp - 2)[$monster sinks its tweeth into you. $monster's HP is $mob_hp. Your HP is now $hp.]
(if: $hp > 0)[
[You cry out and wrench free of its jaws.]
(link-goto: "Attempt escape", "Into the forest")
(link-goto: "Keep fighting", "Fight the giant rat")
]
(else:)[
[YOU HAVE DIED]
(link:"Restart")[(reload:)]
]
]
(else-if: $hero_atk > $mob_atk)[
(set: $mob_hp to $mob_hp - 2)[Your blow hits home. $monster's HP is now $mob_hp. Your HP is $hp.]
(if: $mob_hp > 0)[
[$monster skitters back as your blade slashes into it.]
(link-goto: "Attempt escape", "Into the forest")
(link-goto: "Keep fighting", "Fight the giant rat")
]
(else:)[
[[YOU ARE VICTORIOUS!->Search the rat's nest]]
]
]
(else-if: $mob_atk is $hero_atk)[
[You lunge at each other, but neither of you lands a blow. $monster's HP is $mob_hp. Your HP is $hp.]
(link-goto: "Attempt escape", "Into the forest")
(link-goto: "Keep fighting", "Fight the giant rat")
]
(set: $reputation to $reputation +1)
(set: $rat to "defeated")
Your reputation is now $reputation.
Dozens of smaller rats scurry away as you delve into the creature's stinking nest. They seem rather relieved to be rid of their giant oppressor.
You're convinced that one of the small, agile rodents catches your eye before inclining its nose towards a pile of mouldering cloth and scampering off.
Investigating the heap of rags, you find a (link:"mouldering book")[mouldering book(show:?book)], a (link:"potion")[potion(show:?potion)] and a (link:"phylactery")[phylactery(show:?phylactery)].
|book)[The book is falling apart and reeks of mould, but it seems to have been some kind of adventurer's journal. You can make out one entry:
//Those cheapskates in Spitz didn't even pay gold or give me a decent room after I killed all their wandering monsters for them. I'll show them. You just wait.//
You try to turn the page, but the book crumbles to mush.]
|potion)[After a moment's consideration, you drink the potion. Not poison, apparently. (+2 max health, your health is replenished) (set: $max_hp to $max_hp +2)(set: $hp to $max_hp)]
|phylactery)[A small glass vial appears to contain a piece of rolled parchment and a red fluid that looks a little like blood. Attempting to open it, you can't get the lead-sealed cork, etched with a strange symbol, to shift. You put it in your pouch for later study. (set: $phylactery to 1)]
[[Return to the forest->Into the forest]]
<!-- As well as handing out some sweet loot and a bit of background colour, defeating the giant rat increments the player's $reputation variable by one.
We also set a variable marking the rat as defeated so that it won't appear next time the player enters the cave.
The potion increases the player's maximum hit points by two and fully restores their health to this level. -->(set: $reputation to $reputation +1)
(set: $key to 2)
The crypt is cool and slightly damp, but doesn't have the stench of decay that you'd expected.
A number of sealed stone sarcophagi stand against the walls of the place. In the centre of the room, a larger stone coffin lies open, its lid split in two.
Looking inside, you find no body or bones, but only a few objects, reverently arranged on a red velvet cloth.
These include find a (link:"well-bound book")[book(show:?book)], a (link:"potion")[potion(show:?potion)] and a (link:"folding wooden frame")[folding wooden frame(show:?frame)]
|book)[The book, written by one Mortimer Bookcheek, appears to be a guide to the creatures of the region.
//Ambulatory skeletons: Intimidating but weak, these animated remains of ancient warriors haven't the wit or boldily integrity to be much of a challenge of a well equipped adventurer.
Giant rats: Fierce and agile, these rodents of unusual size are thought to be the product of magical experiments, and are typically hated by their standard-sized relatives. A fitting match for a journeyman warrior.
River nymphs: Possessed of preternatural strength and agility, in addition to the ability to draw strength from their river, there's little chance of a mere mortal prevailing in combat against a river nymph. Ignore their invitations to go swimming.
Ghasts: These undead spirits are bound to this earth by a magical phylactery containging their blood and a scroll of binding. Destroy the phylactery to destroy the ghast. //
You return the book to the sarcophagus with a sigh, wishing that you'd found it earlier.]
|potion)[After a moment's consideration, you drink the potion. Not poison, apparently. (+2 max health, your health is replenished) (set: $max_hp to $max_hp +2)(set: $hp to $max_hp)]
|frame)[Two blocks of wood are hinged together and held shut with a clasp. Opening it, you reveal flattering portraits of a pair of attractive young people. One one, someone has scrawled a magic sigil that you now recognise from the phylactery, along with the phrase: "I will wait here for you forever."
You smile and return it to its resting place. Young love is foolish. Young love with magical powers is dangerous. You hope the mage rests easy in eternity.]
[[Leave the cemetery->Cemetery gates]]
<!-- This is probably going to be the last monster the player takes on, so most of the rewards for defeating it are extra background colour. If you wanted to provide extra clues earlier on, this book could be moved elsewhere to make it more likely that the player would encounter it before beating all the monsters. -->The young woman nods a greeting.
"A visitor! How nice to see a new face, particularly at (link: "this time of year")[this time of year(show:?autumn)]. I don't (link:"get about")[get about(show:?about)] as much as I used to, myself. Do you fancy a (link:"swim")[swim(show:?swim)]?"
|autumn)["It's different in the summer. All the townsfolk come to see me and swim in my river. I get so lonely when it's cold."]
|about)["A nymph is a genius loci: a spirit of a place. We're tied to our place. I'm bound to this river. I used to have a silver (link:"necklace")[swim(show:?necklace)], a protective charm that let me travel further from it, but a warrior stole it from me many, many years ago."]
|swim)["The water's lovely. It'll wash all your cares away and make you forget any hurt you've ever experienced."]
|necklace)["It was a silver pendant with a helm of awe symbol on it. It looks a bit like stylised sun, or maybe a snowflake."
(if: $necklace is "taken")[ [[Give necklace to nymph]] ]]
[[Dive into the water]]
[[Return to the forest->Into the forest]]
<!-- We can use (link:) macros along with (show:) hooks to create a simple keyword based conversation that unfolds as the player clicks on each link. --><!-- Although this is an unwinnable battle, you don't need to change anything in here to make it possible for the player character to defeat the nymph. Everything's set up in the previous passage, Follow the sound of running water -->
Combat against the river nymph!
(set: $hero_roll to (random: 1, 10))
(set: $mob_roll to (random: 1, 10))
(set: $hero_atk to $atk + $hero_roll)
(set: $mob_atk to $monster_atk + $mob_roll)
Dice rattle... your attack is $hero_atk. $monster's attack is $mob_atk.
(if: $mob_atk > $hero_atk)[
(set: $hp to $hp - 2)[$monster strikes you. $monster's HP is $mob_hp. Your HP is now $hp.]
(if: $hp > 0)[
[She strikes you with preturnatural force, sharp talons tearing your skin.]
(link-goto: "Attempt escape", "Into the forest")
(link-goto: "Keep fighting", "Fight the river nymph")
]
(else:)[
[YOU HAVE DIED]
(link:"Restart")[(reload:)]
]
]
(else-if: $hero_atk > $mob_atk)[
(set: $mob_hp to $mob_hp - 2)[Your blow hits home. $monster's HP is now $mob_hp. Your HP is $hp.]
(if: $mob_hp > 0)[
[$monster stumbles but regains her balance.]
(link-goto: "Attempt escape", "Into the forest")
(link-goto: "Keep fighting", "Fight the river nymph")
]
(else:)[
[[YOU ARE VICTORIOUS!->Search the river bed]]
]
]
(else-if: $mob_atk is $hero_atk)[
[You lunge at each other but both miss. $monster's HP is $mob_hp. Your HP is $hp.]
(link-goto: "Attempt escape", "Into the forest")
(link-goto: "Keep fighting", "Fight the river nymph")
]
You find nothing but water and sand, that slips between your fingers.
<!-- The player will never see this passage, as the nymph's stats currently make her unbeatable, but it's here as a placeholder in case we decide to change that by either reducing her stats or increasing the player's stats.
If we were actually to use this sequence, we'd also want to set a flag to ensure that the player doesn't meet the nymph again in future.-->
Persuaded by the nymph's assurances, you dive into the water. The icy current binds you like a chain as your muscles tense up and the shock of cold drives the breath from your body.
The last thing you're aware of is the nymph's laughter, tinkling like water splashing across a rocky weir.
YOU HAVE DIED
(link:"Restart")[(reload:)]
<!-- Although it's almost a tradition to cheat in fantasy gamebooks by just flipping to undo an unwise move, we've provided the option of fully restarting the game with the (reload:) macro.
If we wanted to make the gaming experience a little more hardcore, we could edit our Twine game's default style sheet to remove the back button. You can read more about doing this at http://twinery.org/forum/discussion/comment/10134/#Comment_10134 -->(set: $reputation to $reputation +1)
(set: $necklace to "returned")
You give the necklace from the skeleton warrior's barrow to the nymph and her face lights up.
"My necklace! I thought I'd never see it again!" She leaps up and flings her arms around you in a slightly damp embrace. "I can never thank you enough, but here! Take these!"
She thrusts a bundle into your arms. It contains a (link:"potion")[potion(show:?potion)] and a pair of leather (link:"bracers")[bracers(show:?bracers)].
"I got this stuff from some other adventurers I drown... er. Never mind. Anyway. I'm off travelling! See you again sometime, $name. And don't swim in the river! The currents are fierce!"
Funnily enough, you're sure you never told her your name.
|potion)[After a moment's consideration, you drink the potion. Not poison, apparently. (+2 max health, your health is replenished) (set: $max_hp to $max_hp +2)(set: $hp to $max_hp)
]
|bracers)[The leather wrist-guards vibrate slightly as you touch them. You strap them on. (+2 attack) (set: $atk to $atk +2)
]
Your reputation is now $reputation.
[[Return to the forest->Into the forest]]
<!-- Here's a non-violent win scenario. It's always nice to have a few of these in a game. If you want to make a combat-free pacifist run through your game possible, you could create more of these, with triggers including lost items, games of chance or invisibility cloaks that let you sneak into a treasure room. -->You barely think before grabbing the now red-hot glass vial from your belt pouch and hurling it amongst the gravestones.
A sudden flash of red light erupts from the stones.
The skull-faced ghast halts its approach towards you and lets out an unearthly shriek.
Black tendrils flail around it for a moment before imploding into a pinpoint of blinding white light.
You blink, trying to clear the green and purple spots from your vision. When your sight recovers, it's as if the undead creature had never been there. The graveyard stands calm and tranquil, illuminated by rays of golden light and freshened by a gentle autumn breeze.
The sky is clear, and only a few red leaves blow around the entrance to the large crypt once occupied by the dread spectre.
[[Search the crypt]]
<!-- If the player found the phylactery earlier in the game, they can bypass the battle with the ghast. We've rewarded careful exploration and provided a bit more choice in the process. --><center>
<h4><b>The Road to Adventure</b></h3>
An extensively commented Twine game by Mighty Owlbear.
<h3>[[Start Game->Spitz Adventurers' Guild Barracks]]</h3>
<i>Developed as a companion piece for a tutorial in The MagPi.
Download this game's HTML file from <a href="https://mightyowlbear.itch.io/the-road-to-adventure">https://mightyowlbear.itch.io/the-road-to-adventure</a> for code samples and explanatory notes, which you can look at by importing it into <a href="http://www.twinery.org/">Twine</a>.</i>
Distributed under a Creative Commons Attribution 4.0 International License. You are free to share and reuse any part of this game or its code.
</center>
<!-- We've added this title page so we have somewhere to put credits and references, and so that the game doesn't open with a pop-up prompt box, which you'll see in the next passage. -->As you head down the stairs, you think you hear the tavern keeper mutter something about "damned fools who can't take advice" and wonder if you should (link: "turn back now")[(goto: "Visit the tavern")] or (link-reveal: "keep going down.")[
The stairs seem to go down much further than you'd expect a pub cellar to be. Sooty, flickering torches line the walls and a dank, musty smell fills your nostrils.
At the bottom of the long, long flight of stairs, you come to a metal door with a lever next to it and a sign reading: "Do Not Enter. Danger of Death." A pictogram on the sign shows a stick figure adventurer being eaten by something 'orrible.
Do you really want to go in?
(link: "Actually, on second thought, no.")[(goto: "Visit the tavern")]
[[Yes. Pull the lever already!]]
]
<!-- We're using more (link-reveal:) macros to build up this passage, strongly hinting that the player might not want to go down it in the process. -->You pull the lever and the door slides open with a loud CLANG. A wave of stench hits you in the face as you take a deep breath and step through.
The door slams shut behind you, the sound echoing in your ears. In a dim, greenish light that seems to emanante from everywhere and nowhere, you see that you're standing at the top of a short flight of stairs above a deep pool of water.
On this side, the door behind you is an unopenable steel wall. You see a brick-lined tunnel on the opposite side of the room, just protruding from the water's surface. You think you might be able to fit through it in a pinch.
As you consider your options, a sluice gate somewhere above you crashes open and water begins to pour into the room. Bladed, greenish tentacles rise from the mire, feeling around for anything edible that may have been washed down. You have a horrible feeling that you might be edible.
There's only one thing for it!
(link: "Swim for it - *roll for luck*")[
(set: $roll to (random: 1, 10))
(if: $luck > $roll )[
Dice rattle. Lucky $roll!
You dive for the outflow pipe, narrowly escaping the tentacles. You swim until your arms are tired, until your lungs are fit to burst, until you're sure that you will drown, but somehow you make it out into daylight. Gasping, you claw your way onto the bank of a cold, clear river in the midst of a verdant evergreen forest.
(link: "Follow the stream.")[(set: $swam to 1)(goto: "Follow the sound of running water")]
]
(else:)[
Dice rattle. Unlucky $roll!
You strike out into the outflow tunnel but your breath won't last. Your muscles cramp, and you slip into the water's sultry green grasp. Something cold and sharp wraps itself around your ankle. You have drowned. Your remains will be a delicious treat for the resident hydra.
(link:"Restart?")[(reload:)]]
]
<!-- Here, we're using our $luck stat, set when the player left the Adventurers' Guild Barracks, to see if they can survive the drowning room that we warned them not to enter.
We set the number to beat - the $roll variable - by having the game generate a (random:) number between 1 and 10.
If the player is lucky, we set a variable called $swam to help us customise the next in location we wash them out into - the passage called Follow the sound of running water. -->